<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/financier.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateMouvementTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form>
                <h:panelGrid columns="3">
                    <h:outputLabel value="#{bundle.CreateMouvementLabel_nomMouvement}" for="nomMouvement" />
                    <p:inputText id="nomMouvement" required="true" value="#{mouvementController.selected.nomMouvement}" title="#{bundle.CreateMouvementTitle_nomMouvement}" />
                    <p:message for="nomMouvement"/>
                    <h:outputLabel value="#{bundle.CreateMouvementLabel_compte}" for="compte" />
                    <p:selectOneMenu id="compte" value="#{mouvementController.selected.compte}" title="#{bundle.CreateMouvementTitle_compte}" >
                        <f:selectItems value="#{comptesController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>
                    <p:message for="compte"/>
                    <h:outputLabel value="#{bundle.CreateMouvementLabel_montant}" for="montant" />
                    <p:inputText id="montant" required="true" value="#{mouvementController.selected.montant}" title="#{bundle.CreateMouvementTitle_montant}" />
                    <p:message for="montant"/>
                    <h:outputLabel value="#{bundle.CreateMouvementLabel_debit}" for="debit" />
                    <p:selectBooleanCheckbox id="debit" value="#{mouvementController.selected.debit}" title="#{bundle.CreateMouvementTitle_debit}" />
                    <p:message for="debit"/>
                    <h:outputLabel value="#{bundle.CreateMouvementLabel_categorieMouvement}" for="categorieMouvement" />
                    <p:selectOneMenu id="categorieMouvement" value="#{mouvementController.selected.categorieMouvement}" title="#{bundle.CreateMouvementTitle_categorieMouvement}" >
                        <f:selectItems value="#{categorieMouvementController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>
                    <p:message for="categorieMouvement"/>
                    <h:outputLabel value="#{bundle.CreateMouvementLabel_dateOperation}" for="dateOperation" />
                    <p:calendar id="dateOperation" value="#{mouvementController.selected.dateOperation}" pattern="dd/MM/yyyy"  title="#{bundle.CreateMouvementTitle_dateOperation}" >
                        <f:convertDateTime pattern="dd/MM/yyyy" />
                    </p:calendar>
                    <p:message for="dateOperation"/>
                    <h:outputLabel value="#{bundle.CreateMouvementLabel_dateValeur}" for="dateValeur" />
                    <p:calendar id="dateValeur" value="#{mouvementController.selected.dateValeur}" pattern="dd/MM/yyyy"  title="#{bundle.CreateMouvementTitle_dateValeur}" >
                        <f:convertDateTime pattern="dd/MM/yyyy" />
                    </p:calendar>
                    <p:message for="dateValeur"/>
                    <h:outputLabel value="#{bundle.CreateMouvementLabel_description}" for="description" />
                    <p:inputText id="description" value="#{mouvementController.selected.description}" title="#{bundle.CreateMouvementTitle_description}" />
                    <p:message for="description"/>
                    <h:outputLabel value="#{bundle.CreateMouvementLabel_rapprochement}" for="rapprochement" />
                    <p:selectOneMenu id="rapprochement" value="#{mouvementController.selected.rapprochement}" title="#{bundle.CreateMouvementTitle_rapprochement}" >
                        <f:selectItems value="#{rapprochementController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>
                    <p:message for="rapprochement"/>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{mouvementController.create}" value="#{bundle.CreateMouvementSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{mouvementController.prepareList}" value="#{bundle.CreateMouvementShowAllLink}" immediate="true"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
